package com.sgy;

import com.sgy.jar_package.JarPackageInfo;
import com.sgy.jar_package.JarPackageOfRegister;
import com.sgy.lib.RegistryLibPackageMark;
import com.sgy.config.SystemProperties;
import com.sgy.config.ThreadPoolProperties;
import com.sgy.utils.EPlatform;
import com.sgy.utils.OSInfo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

import java.io.File;

/**
 * @author shenguangyang
 * @date 2022-08-14 6:07
 */
@SpringBootApplication
@EnableConfigurationProperties({SystemProperties.class, ThreadPoolProperties.class})
public class ClientApplication {
    public static void main(String[] args) {
        JarPackageOfRegister.register(
                new JarPackageInfo(
                        EPlatform.Windows,
                        RegistryLibPackageMark.class,
                        "proxy-client.jar"
                        ), () -> System.getenv("JAVA_HOME")  + File.separator + "bin");

        if (OSInfo.isWindows()) {
            String hikWin64libRootPath = JarPackageOfRegister.getLibRootPath(RegistryLibPackageMark.class);
            System.out.println("ICE_JNIRegistry win64 lib path: " + hikWin64libRootPath);
        }
        SpringApplication.run(ClientApplication.class, args);
    }
}
